AC_INIT(slimp, 0.0.1)
AC_CONFIG_SRCDIR(src/main.c)
AC_PREREQ(2.57)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)

debuger=no
AC_ARG_ENABLE(debug,
	AC_HELP_STRING(
	    [--enable-debug],
	    [enable debug data generation (def=no)]
	),
  	debuger="$enableval"
)

# resulting value to screen (to complete checking message)
AC_MSG_RESULT($debuger)

AM_CONDITIONAL(DEBUG, test "$debuger" = yes)

AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_INSTALL

PKG_CHECK_MODULES(DEPS, gtk+-2.0 glib-2.0 libglade-2.0 avahi-client gthread-2.0)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)

#if test x"$debuger" ; then
	#AC_DEFINE(DEBUG)
#	CXXFLAGS="$CXXFLAGS -g3 -Wall -Werror"
#	CPPFLAGS="$CPPFLAGS -g3 -Wall -Werror"
#	CFLAGS="$CFLAGS -g3 -Wall -Werror"
#fi

#./glade-embed.sh glade_xml_string src/slimp.glade src/glade_xml.h

AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_COMMANDS([default],[[ echo timestamp > stamp-h ]],[[]])
./glade-embed.sh glade_xml_string src/slimp.glade src/glade_xml.h
AC_OUTPUT
